<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of NewsController
 *
 * @author Константин Охотник
 */

namespace Jacov\JacovBundle\Controller;

use Jacov\JacovBundle\Controller\MainController;
use Jacov\JacovBundle\Entity\News;
use Jacov\JacovBundle\Model\NewsModel;

class NewsController extends MainController
{
    private $_NewsModel;
    public function indexAction()
    {
        $this->_NewsModel = new NewsModel($this->getDoctrine()->getManager());
        return $this->render(
            'JacovJacovBundle:Content:news.html.twig',
            array('news'=>$this->_NewsModel->getAllNews())    
        );
    }
}
